home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93a.txt / 000065_icon-group-sender _Sun Feb 14 07:05:44 1993.msg < prev    next >
Internet Message Format  |  1993-04-21  |  3KB

  1. Received: by cheltenham.cs.arizona.edu; Sun, 14 Feb 1993 14:09:12 MST
  2. Date: 14 Feb 93 07:05:44 GMT
  3. From: digex.com!digex.com!not-for-mail@uunet.uu.net  (Pat)
  4. Organization: UDSI
  5. Subject: novicey beginner question
  6. Message-Id: <1lkr08INNcn7@access.digex.com>
  7. Sender: icon-group-request@cs.arizona.edu
  8. To: icon-group@cs.arizona.edu
  9. Status: R
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12.  
  13.  
  14.  
  15. I am just starting out learning ICON and am having a tough time
  16. trying to make something work.  I realize this is a real undergraddy
  17. type question,  but I am taking a night course, and the professor is
  18. not available.  
  19.  
  20. I am trying to write a procedure that given a string looks to see
  21. if there are any curly braces and cuts out whatever is between them.
  22.  
  23. this is what i am up to,  and i am having a hard time trying to
  24. hang it all together.
  25.  
  26. procedure  foo (line)
  27.  
  28. line_ptr := 0    #  initialize a line ptr
  29. com_set := '{}'  #  establish a cset of the things of interest
  30.  
  31.     line ? {
  32.         if not find(com_set)
  33.         then return line  #  if there is no curly return it
  34.         else {
  35.             temp := inline(tab(upto(comset))) #scissor out
  36.             return temp    # the stuff between curlies
  37.             }
  38.         }
  39. end # foo
  40.  
  41. this is not really right,  and i thought I'd ask you all what conceptual
  42. leap i am missing.  the problem is in the temp assignment.
  43. If i can get this darn utility routine to work, the rest of the
  44. program should come along quite nicely.
  45.  
  46. Thank you for your time,  and pardon me if this is an inappropriate 
  47. posting.
  48.  
  49. pat
  50. Newsgroups: comp.lang.icon
  51. Subject: novicey, beginner type question
  52. Summary: 
  53. Followup-To: 
  54. Distribution: world
  55. Organization: UDSI
  56. Keywords: 
  57.  
  58. Newsgroups: um.dining
  59. Subject: test.
  60. Summary: 
  61. Followup-To: 
  62. Distribution: um
  63. Organization: UDSI
  64. Keywords: 
  65.  
  66.  
  67. Newsgroups: alt.lang.icon
  68. Subject: Novice beginner type question.
  69. Summary: 
  70. Followup-To: 
  71. Distribution: world
  72. Keywords: 
  73.  
  74.  
  75.  
  76. I am just starting out learning ICON and am having a tough time
  77. trying to make something work.  I realize this is a real undergraddy
  78. type question,  but I am taking a night course, and the professor is
  79. not available.  
  80.  
  81. I am trying to write a procedure that given a string looks to see
  82. if there are any curly braces and cuts out whatever is between them.
  83.  
  84. this is what i am up to,  and i am having a hard time trying to
  85. hang it all together.
  86.  
  87. procedure  foo (line)
  88.  
  89. line_ptr := 0    #  initialize a line ptr
  90. com_set := '{}'  #  establish a cset of the things of interest
  91.  
  92.     line ? {
  93.         if not find(com_set)
  94.         then return line
  95.         else {
  96.             temp := inline(tab(upto(comset)))
  97.             return temp
  98.             }
  99.         }
  100. end # foo
  101.  
  102. this is not really right,  and i thought I'd ask you all what conceptual
  103. leap i am missing.  the problem is in the temp assignment.
  104. If i can get this darn utility routine to work, the rest of the
  105. program should come along quite nicely.
  106.  
  107. Thank you for your time,  and pardon me if this is an inappropriate 
  108. posting.
  109.  
  110. pat
  111.